package com.ps.service.salary.imp;

import java.util.ArrayList;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;

import com.ps.dao.BaseDaoSupport;
import com.ps.dao.salary.SalarySetOfBooksDAO;
import com.ps.entity.Result;

import com.ps.pojo.salary.SalarySetOfBooks;
import com.ps.service.BaseServiceSupport;
import com.ps.service.salary.SalarySetOfBooksService;

public class SalarySetOfBooksServiceImp extends
		BaseServiceSupport<SalarySetOfBooks> implements SalarySetOfBooksService {
	@Autowired
	private SalarySetOfBooksDAO salarySetOfBooksDAO;
	
	@Override
	public BaseDaoSupport<SalarySetOfBooks> getBaseDao() {
		// TODO Auto-generated method stub
		return salarySetOfBooksDAO;
	}

	public Result findByPage(int pageSize, int startIndex) {
		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(SalarySetOfBooks.class);
		ArrayList<Order> orders = new ArrayList<Order>();
		orders.add(Order.desc("ssobId"));
		return this.findPageByCriteria(detachedCriteria, pageSize, startIndex, orders);
	}

}
